Github  Flavors

Начало работы

Вы можете начать использовать mini.css одним из многих способов. Он опубликован на npm и yarn, так что вы можете легко загрузить его, используя предпочитаемый менеджер пакетов:

npm install mini.css
yarn add mini.css

Кроме того, вы можете использовать rawgit или cdnjs для импорта mini.css в тег <head> вашей HTML-страницы:

<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v3.0.1/dist/mini-default.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css">

После добавления mini.css в свой проект, не забудьте также добавить следующую строку внутри вашей HTML-страницы <head> тег для использования метатега viewport:

<meta name="viewport" content="width=device-width, initial-scale=1">

mini.css создана с учетом долгосрочной поддержки, поэтому ожидайте, что она будет совместима со всеми современными браузерами, а также с их будущими версиями. Однако большинство устаревших и прокси-браузеров, таких как Internet Explorer, Opera Mini, IE Mobile и UC Browser, официально не поддерживаются, что означает, что некоторые функции могут отображаться неправильно или работать не так, как ожидается.


edge

  Edge15

firefox

 Firefox35

chrome

 Chrome49

safari

 Safari9.1

opera

 Opera36

android

 Android56

Поддержка браузерами


Работа с текстом

mini.css utilizes the ruleset of Normalize.css v7.0.0 to reliably deal with inconsistencies between browsers, while applying some tasteful defaults on top, such as using native font stack to figure out the best font for each device, setting the background and foreground colors, as well as the size of the text to 16px and its line height to 1.5.

All of the most common HTML5 elements, such as paragraphs, links, bold, small and slanted text, have been styled by default using clean, modern typography to make your pages look cool and stand out from the rest of the internet.

Пример

This is a paragraph with some sample text. Did you know that the latest version of mini.css is codenamed Gluon? Well, now you do!


Remember that mini.css is totally free, no fine print involved!

Пример кода

<p>This is a paragraph. with some <strong>bold text</strong> and some <em>italics text</em>.</p> <a href="#">This is a link.</a> <small>This is some small text.</small> <sub>Subscript</sub> <sup>Superscript</sup> <hr/>

Практика

/* Do not do this (use Sass instead) */
html {
  font-size: 14px;
}

Не рекомендуется:  Старайтесь не изменять базовый размер шрифта 16 пикселей в своем CSS-коде, так как это может вызвать проблемы с отображением определенных элементов.

Кастомизация

  • Text color can be changed globally by changing the value of the --fore-color variable.
  • Background color can be changed globally by changing the value of the --back-color variable.
  • Border color can be changed globally by changing the value of the --border-color variable. This affects the color of <hr> elements.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • You can change the color of links by changing the values of the --a-link-color and --a-visited-color variables.

Заголовки

All of the HTML5 heading elements are styled, using a customizable ratio and simple rules, providing a clean base for your web app's titles. Apart from the headings themselves, customized rules are provided for displaying subheadings or explanatory text below your web app's headings.

Пример

Heading 1Subheading

Heading 2Subheading

Heading 3Subheading

Heading 4Subheading

Heading 5Subheading
Heading 6Subheading

Пример кода

<h1>Heading 1 <small>Subheading</small></h1> <h2>Heading 2 <small>Subheading</small></h2> <h3>Heading 3 <small>Subheading</small></h3> <h4>Heading 4 <small>Subheading</small></h4> <h5>Heading 5 <small>Subheading</small></h5> <h6>Heading 6 <small>Subheading</small></h6>

Кастомизация

  • Text color can be changed globally by changing the value of the --fore-color variable. This will affect the color of the headings' main text.
  • Secondary text color can be changed globally by changing the value of the --secondary-fore-color variable. This will affect the color of subheadings.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • You can change the ratio of headings' size by chaning the value of the --heading-ratio variable. Bear in mind that the value of this variable must be unitless to work properly.

Изображения и подписи

Image elements are responsive by default, automatically scaling down as necessary to display properly on smaller devices. Images retain their original aspect ratio and they will never scale above their original size.

If you want to add captions to images, you can use HTML5 figure elements, along with their related captions.

Пример

placeholder
Image caption

Пример кода

<img src="image.png" alt="Image description"/>
<figure> <img src="image.png" alt="Image description"/> <figcaption>Image caption</figcaption> </figure>

Примечание

  • While not mandatory, it is considered a good practice to always add a alt attribute to image elements on your web apps.

Кастомизация

  • You can change the text color of <figcaption> elements by changing the value of the --secondary-fore-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.

Списки

List elements, both unordered and ordered, are minimally styled to match with the rest of the framework's aesthetics. Their margins and padding are reset to properly align with the rest of the common HTML5 elements, providing a stable foundation for all of your web app's Списки.

Пример

  • Apple
  • Orange
  • Strawberry

  1. Wake up
  2. Eat breakfast
  3. Go to work

Пример кода

<ul> <li>Apple</li> <li>Orange</li> <li>Strawberry</li> </ul> <ol> <li>Wake up</li> <li>Eat breakfast</li> <li>Go to work</li> </ol>

Кастомизация

  • Text color can be changed globally by changing the value of the --fore-color variable.
  • Background color can be changed globally by changing the value of the --back-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.

Code & quotations

Code blocks and quotation elements are styled using custom rules that help make them stand out from the rest of the text, while inline code and keyboard input tags are minimally styled, aiming not to break the flow of regular text.

Пример

This is some text with some inline source code and some keyboard input.

function sum(num1, num2){
  return num1 + num2;
}
This is some text quoted from elsewhere.

Пример кода

<p>This is some text with some inline <code>source code</code> and some keyboard <kbd>input</kbd>.</p> <pre>function sum(num1, num2){ return num1 + num2; }</pre> <blockquote cite="www.quotation.source">This is some text quoted from elsewhere.</blockquote>

Примечание

  • The cite attribute of <blockquote> elements is not mandatory and can be omitted. The element's sizing will be automatically adjusted according to the presence of the cite attribute.

Кастомизация

  • Text color can be changed globally by changing the value of the --fore-color variable. This will affect the text color of <code> and <pre> elements and background color of <kbd> elements.
  • Background color can be changed globally by changing the value of the --back-color variable. This will affect the background color of <blockquote> elements and text color of <kbd>.
  • You can change the background color of <code> and <pre> elements by changing the value of the --secondary-back-color variable.
  • You can change the text color of <blockquote> elements by changing the value of the --secondary-fore-color variable.
  • You can change the border color of <pre> and <blockquote> elements by changing the value of the --secondary-border-color variable.
  • You can change the border color of the left border of <pre> elements by changing the value of the --pre-color variable.
  • You can change the border color of the left border of <blockquote> elements by changing the value of the --blockquote-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Система сеток

The Система сеток of mini.css utilizes the Flexbox layout to provide you with a simple, modern, responsive layout system for your web apps. Like most modern CSS frameworks' Система сетокs, it is composed of three main components - containers, rows and columns:

  • The container (.container) is the outermost layer of the Система сеток and serves as a fluid wrapper, which can be used as the basis for your layout.
  • Inside the container, you can add one or more rows (.row), which will in turn house the columns.
  • Columns (col-*-*) are placed inside rows and they can be customized to display differently on different screen sizes, make use of fluid layouts, use offsets or change ordering.

Пример

1
11
2
10
3
9
4
8
5
7
6
6
12
fluid
fluid

Пример кода

<div class="container"> <div class="row"> <div class="col-sm-1"></div> <div class="col-sm-11"></div> </div> <div class="row"> <div class="col-sm-2"></div> <div class="col-sm-10"></div> </div> <div class="row"> <div class="col-sm-3"></div> <div class="col-sm-9"></div> </div> <div class="row"> <div class="col-sm-4"></div> <div class="col-sm-8"></div> </div> <div class="row"> <div class="col-sm-5"></div> <div class="col-sm-7"></div> </div> <div class="row"> <div class="col-sm-6"></div> <div class="col-sm-6"></div> </div> <div class="row"> <div class="col-sm-12"></div> <div class="row"> <div class="col-sm"></div> <div class="col-sm"></div> </div> </div>

You can use the Система сеток to create a responsive media object in one of many ways. Below is a simple Пример of a two-column media object with an image and some text:

<div class="row"> <div class="col-sm-2"> <img src="image.png" alt="Image description"/> </div> <div class="col-sm"> <h2>Media object heading</h2> <p>Media object content...</p> </div> </div>

Modifiers

Screen sizes and width

Each column class is defined by specifying a screen size (small - sm, medium - md or large - lg) and a column width (a value between 1 and 12 or you can omit it for a fluid column), separated by dashes (e.g. .col-sm-6 for a 6-wide column on a small screen). Using these you can apply different layouts for different screen sizes, by altering the width of columns, using multiple classes. Note that column widths are applied recursively, meaning that if you do not specify a width for a specific screen size the column will use the width applied for the previous largest screen size.

Пример
Small screen layout
sm-12
sm-12 md-8
sm-12 md-4
sm-12
Medium/Large screen layout
sm-12
sm-12 md-8
sm-12 md-4
sm-12
Пример кода
<div class="container"> <div class="row"> <div class="col-sm-12 col-md-3 col-lg-2"></div> <div class="col-sm-12 col-md-5 col-lg-7"></div> <div class="col-sm-12 col-md-4 col-lg-3"></div> </div> <div class="row"> <div class="col-sm col-lg-10"></div> <div class="col-sm-4 col-md"></div> </div> </div>

Predefined layouts

Rows can be modified to apply predefined layouts to the columns inside them, effectively reducing the amount of work required for simple layouts. To create a predefined layout, you can add a class to a row (.cols-*-*), specifying a screen size and width for the columns inside it (or omitting the width for fluid columns), similarly to the way columns are defined (e.g. .row.cols-sm-6 will cause all elements inside the row to be 6-wide on a small screen). Columns inside a predefined layout do not require any further classes to display and, much like normal column layouts, their widths are applied recursively.

Пример кода
<div class="row cols-sm-6"> <div> <p>This paragraph is inside a 6-wide column.</p> </div> <div> <p>This paragraph is inside a 6-wide column.</p> </div> </div>

Column offsets

Columns can be moved to the right, by applying offset classes (.col-*-offset-*), defining a screen size and an offset (a value between 0 and 11, e.g. .col-sm-offset-3 will move a column 25% to the right on a small screen). Like all other column modifiers, offsets are applied recursively.

Пример
11
10
9
8
7
6
5
4
3
2
1
0
Пример кода
<div class="row"> <div class="col-sm-8 col-sm-offset-2 col-md-offset-1 col-lg-offset-0"></div></div> <div class="row"> <div class="col-sm col-sm-offset-3 col-md-offset-4 col-lg-offset-0"></div> </div> <div class="row"> <div class="col-sm-4 col-md-offset-5"></div> </div>

Column reordering

Columns can be reordered on different screen sizes, by applying a reordering class (.col-*-*), defining a screen size and the order (first, normal or last, e.g. .col-sm-last will move a column to the end of its row on a small screen). Like all other column modifiers, reordering is applied recursively.

Пример
Small screen layout
md-last
 
md-first
Medium/Large screen layout
md-first
 
md-last
Пример кода
<div class="row"> <div class="col-sm col-md-last col-lg-normal"></div> <div class="col-sm col-sm-first col-md-last"></div> <div class="col-sm col-md-first col-lg-normal"></div> </div>

Практика

<div class="col-sm-3">
  <div class="container"></div>
</div>
<div class="col-sm-3">
  <div class="row"></div>
</div>
<div class="col-sm-3 row">
  <div class="col-sm-6"></div>  <div class="col-sm-6"></div>
</div>

Рекомендуется:  Столбец может содержать контейнер или строку внутри него или даже быть строкой одновременно. В последнем случае он будет действовать как столбец для родительской строки и как строка для своих дочерних элементов.


<div class="row">
  <div class="col-sm-12"></div>
  <div class="col-sm"></div>  <div class="col-sm-4"></div>
</div>

Рекомендуется:  You can mix fluid columns with fixed, if you like. Fluid columns will adapt to the size of the container left for them. You can also use columns whose total width exceeds 12 (100%). The remaining content will flow below the rest, allowing you to specify multiple blocks of content inside the same row if you need to.


<div class="row">
  <div class="col-sm-12 col-md-6"></div>
  <div class="col-sm-12 col-md-6"></div>
</div>

Рекомендуется:  You can change the layout of your content for different displays, laying out your content vertically on smaller screens or horizontally on larger screens. If your columns exceed a total width of 12 (100%) on some displays, they will wrap accordingly.


<div class="row">
  <div class="col-sm col-lg-3 col-md-last"></div>
  <div class="col-sm-6 col-md-offset-2"></div>
</div>

Рекомендуется:  You do not need to specify a column's width or reapply offset and reordering modifiers if they are the same as the previous screen size.


<div class="row cols-sm-12 cols-md-6">
  <div></div>  <div></div>
</div>

Рекомендуется:  You can add multiple predefined layout classes for different screen sizes, allowing you to build responsive predefined layouts.


<div class="row">
  <div class="col-sm-8 col-sm-offset-1 col-md-offset-0"></div>
  <div class="col-sm-last col-md-normal"></div>
</div>

Рекомендуется:  To remove a previously applied offset from a column (i.e. one applied from the layout from a smaller screen size) or to make sure no offsets are active on a column, you can set its offset to 0 for a specific screen size. Similarly, to remove previously applied reordering modifiers from a column, you can set its order to normal.

<div class="col-sm">
  <div class="col-sm"></div>
</div>

Не рекомендуется:  Избегайте размещения столбца непосредственно внутри другого столбца. Вместо этого всегда используйте строку для переноса столбцов.


<div class="container">
  <div class="row">
    <div class="col-sm"></div>
    <p>Do not do this.</p>
  </div>
  <p>Do not do this.</p>
</div>

Не рекомендуется:  Avoid mixing rows and columns with normal content that is not wrapped on the respective level of the grid layout.


<div class="row">
  <div class="col-md"></div>
</div>
<div class="row cols-md"></div>

Не рекомендуется:  Never omit the class that specifies a column's width for the small screen size. You can omit all other classes and modifiers, except for this. This also applies to predefined layouts.


<div class="row cols-sm-6">
  <div class="row cols-sm-4"></div>
</div>

Не рекомендуется:  Avoid combining normal column width modifiers with predefined layouts, as the predefined layout will most likely override the width modifier of the column.

Примечание

  • mini.css uses a mobile-first approach in its Система сеток, so you do not have to rewrite the same layout for all three screen sizes. Leaving a column's size, offset or order unspecified for a screen size will use the style applied for the previous largest screen size recursively. This also applies to predefined layouts.
  • The specific breakpoints for small, medium and large screen sizes are as follows:
    • small: less than 768px wide
    • medium: more than or equal to 768px wide and less than 1280px wide
    • large: 1280px wide or more
  • In many cases, you can omit the container and just use rows and columns. You only need to make sure that all of your rows have the same parent element.
  • You can use fluid columns to create columns whose width is not a multiple of 1/12th of the screen's width (e.g. if you have 7 fluid columns in a row, each one of them will be 1/7th of the screen's width).
  • Predefined layouts can be combined with most of the features of the Система сеток, such as offsets and reordering, however they do not combine very well with regular columns.
  • You should only apply offset and reordering modifiers to the columns that you need and for the screen sizes that are necessary. Remember to also specify a column width or use a predefined layout before applying these modifiers.

Кастомизация

  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable. This only affects the padding of the container.

Карточки

mini.css provides you with Карточки (.card), general-purpose containers that help you organize the content of your web apps. Карточки should be used in combination with the Система сеток, meaning that they need to be placed inside a grid's rows to work properly. Layouts created with Карточки are responsive, realigning according to the available size on the screen.

Пример

Card 1

This is a basic card with some sample content.

Card 2

This is another card with some sample content.

Card 3

This is one more card with some sample content.

Пример кода

<div class="row"> <div class="card"></div> <div class="card"></div> </div>

Modifiers

Alternative sizes

You can create small (.small, 240px wide) or large (.large, 480px wide) Карточки by applying the appropriate modifiers to a card. Apart from that, you can also create fluid (.fluid) Карточки, that take up as much space as is available, however you will have to place these Карточки inside a grid layout's columns, effectively adding one extra step for them to display properly.

Пример

Small Card

Small Карточки are 240px wide.

Large Card

Large Карточки are 480px wide.

Fluid Card

Fluid Карточки scale their width based on the column that contains them.

Пример кода
<div class="row"> <div class="card small"></div> <div class="card large"></div> <div class="col-sm-12"> <div class="card fluid"></div> </div> </div>

Color variants

You can display warning (.warning) or error (.error) messages using Карточки, simply by adding the appropriate color modifiers to a card.

Пример

Warning Card

Warning Карточки are used to display important information to users.

Error Card

Error Карточки are used to display error messages to users.

Пример кода
<div class="row"> <div class="card warning"></div> <div class="card error"></div> </div>

Практика

<div class="card">
  <div class="row">
    <div class="card"></div>
  </div>
</div>

Рекомендуется:  You can create rows inside a card, which can in turn contain other Карточки.

<div class="card row"></div>
<div class="card col-sm"></div>

Не рекомендуется:  An element cannot be a card and a row or column at the same time.


<div>
  <div class="card"></div>
</div>

Не рекомендуется:  Never forget to wrap your Карточки inside a row and your fluid Карточки inside a row and a column.


<div class="row">
  <div class="card"></div>
  <div class="card fluid"></div>
</div>

Не рекомендуется:  Try not to combine fixed-width and fluid Карточки. Instead, combine fixed-width Карточки with columns and place fluid Карточки inside them.


<div class="card warning error"></div>

Не рекомендуется:  Avoid applying two color modifiers on the same card.

Примечание

  • Due to the fact that fluid Карточки stretch to fill their parent container, they might not fully respect their margins sometimes, although this should not cause any noticable problems in your web apps' layouts.

Кастомизация

  • Text color for Карточки can be changed by changing the value of the --card-fore-color variable.
  • Background color for Карточки can be changed by changing the value of the --card-back-color variable.
  • Border color for Карточки can be changed by changing the value of the --card-border-color variable.
  • You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Разделы с карточками

Card content is usually organized in smaller sections (.section) to be more easily digestible. A card section can be any valid HTML5 element with the appropriate class applied to it.

Пример

Title section

This is a section with some textual content.

Пример кода

<div class="card"> <div class="section"></div> <div class="section"></div> </div>

Modifiers

Media sections

You can create sections for media (.media), such as images or videos (using an <img> or a <iframe> element respectively). These sections are styled appropriately for presentation of media content, meaning that the content will scale appropriately to fill up the available space.

Пример

Card with image

placeholder

Card with video

Пример кода
<div class="card"> <img src="image.png" class="section media"/> </div>

Color variants

You can create sections with a darker (.dark) background, by applying the appropriate modifier.

Пример

Normal section

Dark section

Пример кода
<div class="card"> <div class="section dark"></div> </div>

Additional spacing

You can create sections with additional spacing (.double-padded), by applying the appropriate modifier.

Пример

Normal spacing

Additional spacing

Пример кода
<div class="card"> <div class="section double-padded"></div> </div>

Практика

<div class="card">
  <div class="section"></div>
  <p>This should have been a section!</p>
</div>

Не рекомендуется:  Avoid mixing regular content with content in sections. Instead, wrap all of your card's contents in sections.

Примечание

  • While not mandatory, it is highly suggested that you wrap all of your Карточки' contents in one or more sections.
  • Remember that a section can be any valid HTML5 element, so you can apply them to headings, paragraphs, input elements etc.
  • Media sections have a default height of 200px.
  • Due to the media sections using object-fit, you might want to use a polyfill for better browser support (recommended: image polyfill, video polyfill).
  • Depending on the source website, some embedded videos might not display properly as media sections.

Кастомизация

  • Text color for Карточки and Разделы с карточками can be changed by changing the value of the --card-fore-color variable.
  • Background color for Карточки and Разделы с карточками can be changed by changing the value of the --card-back-color variable.
  • Border color for Карточки and Разделы с карточками can be changed by changing the value of the --card-border-color variable.
  • You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.

Forms & input

Forms, labels and common HTML5 input elements have been styled using clean, modern rules, improving the accessibility and usability of your web apps' forms.

Пример

Sample form

Пример кода

<form> <fieldset> <legend>Simple form</legend> <label for="username">Username</label> <input type="text" id="Username" placeholder="Username"/> <label for="password">Password</label> <input type="password" id="password" placeholder="Password"/> </fieldset> </form>

Практика

<form>
  <fieldset>
    <legend>Simple form</legend>
    <div> class="row">
      <div> class="col-sm-12 col-md-6">
        <label for="username">Username</label>
        <input type="text" id="Username" placeholder="Username"/>
      </div>
      <div> class="col-sm-12 col-md-6">
        <label for="password">Password</label>
        <input type="password" id="password" placeholder="Password"/>
      </div>
    </div>
  </fieldset>
</form>

Рекомендуется:  Form inputs are inline by defaut, however you can combine forms with the Система сеток to create aligned forms.

Примечание

  • Using the <fieldset> and <legend> elements is highly recommended, as it improves semantic markup and accessibility.
  • Some input elements, such as date & time, color and range types, are not supported and, as a result, do not have a default style defined for them. You can define said styles manually if you need to use them in your web app.

Кастомизация

  • Text color for forms and legend elements can be changed by changing the value of the --form-fore-color variable.
  • Background color for forms can be changed by changing the value of the --form-back-color variable.
  • Border color for forms and fieldset elements can be changed by changing the value of the --form-border-color variable.
  • Text color for input elements can be changed by changing the value of the --input-fore-color variable.
  • Background color for input elements can be changed by changing the value of the --input-back-color variable.
  • Border color for input elements can be changed by changing the value of the --input-border-color variable.
  • Border color for focused and invalid input elements can be changed by changing the value of the --input-focus-color and --input-invalid-color variables respectively.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Кнопки

Кнопки and button-like input elements have been styled by default to be consistent across browsers. You can also style other elements, such as links or form labels, to look like Кнопки, using the appropriate class (.button) or the button role.

Пример

Link

Пример кода

<button>Button</button> <input type="button" value="Button" /> <input type="reset" value="Button" /> <input type="submit" value="Button" /> <a href="#" class="button">Link</a> <a href="#" role="button">Link</a> <label class="button">Label</label> <label role="button">Label</label>

Modifiers

Color variants

To make your Кнопки stand out, you can give them a primary (.primary), secondary (.secondary), tertiary (.tertiary) or inversed (.inverse) color palette.

Пример
Пример кода
<button class="primary">Primary</button> <button class="secondary">Secondary</button> <button class="tertiary">Tertiary</button> <button class="inverse">Inverse</button>

Size variants

You can make Кнопки smaller (.small) or larger (.large), by applying the appropriate modifier.

Пример
Пример кода
<button class="small">Small</button> <button class="large">Large</button>

Практика

<input type="file" id="file-input" style="display:none" />
<label for="file-input" class="button">Upload file</label>

Рекомендуется:  File upload inputs are not styled by default, due to inconsistencies in how browsers handle them. If you want them to look like other Кнопки, you can hide them and use a linked label.

<button class="primary inverse">Button</button>
<button class="small large">Button</button>

Не рекомендуется:  Avoid applying multiple modifiers of the same type on the same button.

Примечание

  • It is recommended to use the button role instead of the provided class, if you want your custom Кнопки to be fully accessible.

Кастомизация

  • Text color for Кнопки can be changed by changing the value of the --button-fore-color variable.
  • Background color for Кнопки can be changed by changing the value of the --button-back-color variable.
  • Border color for Кнопки can be changed by changing the value of the --button-border-color variable.
  • Background and border color for focused Кнопки can be changed by changing the values of the --button-hover-back-color and --button-hover-border-color variables respectively.
  • You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Input grouping

You can ensure that input elements and labels display together on the same line, by grouping them together (.input-group). You can also group Кнопки together, using a different grouping class (.button-group).

Пример

Grouped inputs

Пример кода

<div class="input-group"> <label for="username">Username</label> <input type="text" id="Username" placeholder="Username"/> </div>
<div class="button-group"> <button>Button</button> <button>Button</button> <button>Button</button> </div>

Modifiers

Fluid & vertical grouping

You can make your input groups fluid (.fluid) or vertical (.vertical), by applying the appropriate modifiers.

Пример
Fluid input groups
Vertical input groups
Пример кода
<div class="input-group fluid"> <label for="username">Username</label> <input type="text" id="Username" placeholder="Username"/> </div> <div class="input-group vertical"> <label for="username">Username</label> <input type="text" id="Username" placeholder="Username"/> </div>

Практика

<div class="input-group row">
  <div class="col-sm">
    <label for="username">Username</label>
    <input type="text" id="Username" placeholder="Username"/>
  </div>
</div>

Не рекомендуется:  Avoid combining input groups with the Система сеток, as there might be overlapping styles.

Примечание

  • It is highly recommended that you do not place checkboxes or radio Кнопки inside fluid or vertical input groups.
  • Button groups will display horizontally on medium and large screens, but collapse into a vertical view on small screens.




Menu drawer

The drawer component of mini.css is used to create responsive navigation menus for your web apps. It is composed of three components - the drawer, the toggle button and the close button:

  • To create a drawer, simply create a checkbox input, applying the appropriate class to it (.drawer), immediately followed by a container of your liking (e.g. a <div> or <nav>). The former serves as your drawer's control, while the latter is the actual drawer container.
  • Create a label anywhere outside your drawer's container for the checkbox controlling your drawer, applying the appropriate class (.drawer-toggle). This will serve as the toggle button for your drawer menu.
  • Finally, inside your drawer's container, add another label for the checkbox controlling your drawer, applying the appropriate class (.drawer-close). This will serve as the close button for your drawer menu.

Пример


Пример кода

<label for="drawer-control" class="drawer-toggle"></label> <input type="checkbox" id="drawer-control" class="drawer"> <div> <label for="drawer-control" class="drawer-close"></label> <a href="#">Home</a> </div>

Modifiers

Persistent drawer

If you want your drawer menus to not expand into normal containers on larger screens, simply add the appropriate modifier (.persistent) on the checkbox controlling the drawer and its toggle button.

Пример кода
<label for="drawer-control" class="drawer-toggle persistent"></label> <input type="checkbox" id="drawer-control" class="drawer persistent"> <div> <label for="drawer-control" class="drawer-close"></label> <a href="#">Home</a> </div>

Практика

<div class="row">
  <input type="checkbox" id="drawer-control" class="drawer">
  <div class="col-md-4">
    <label for="drawer-control" class="drawer-close"></label>
    <a href="#">Home</a>
  </div>
  <div class="col-sm-12 col-md-8">
    <p>Page content</p>
  </div>
</div>

Рекомендуется:  You can combine the drawer menu with the Система сеток to create responsive menus that are part of the layout of your web app.

<input type="checkbox" id="drawer-control" class="drawer">
<!-- Do not place other stuff between these -->
<div>
  <label for="drawer-control" class="drawer-close"></label>
  <a href="#">Home</a>
</div>

Не рекомендуется:  You should not place anything between the checkbox controlling the drawer and the container.

Примечание

  • Drawer menus are responsive by default and will expand into normal containers on screens larger or equal to 768px wide.
  • It is highly recommended to place your drawer's toggle button inside your web app's header element.
  • You can combine the Навигация element with the drawer menu for better results.
  • Remember to apply the appropriate classes to any and all elements, as indicated in the Примерs. Failing to do so will result in the drawer menu not rendering or behaving properly.

Кастомизация

  • Text color can be changed globally by changing the value of the --fore-color variable. This will affect the text color of the toggle button and items inside the drawer container.
  • Background color for the drawer container can be changed by changing the value of the --drawer-back-color variable.
  • Border color for the drawer container can be changed by changing the value of the --drawer-border-color variable.
  • Text color for the drawer close button can be changed by changing the values of the --drawer-close-color.
  • Background color for the drawer close button when focused or hovered over can be changed by changing the values of the --drawer-hover-back-color.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Таблицы

Таблицы are styled in a minimal, modern and responsive manner, allowing users on all devices to easily browse tabular data, taking advantage of the Flexbox layout's capabilities. To make tabular data properly display on mobile devices, remember to specify a data-label attribute for each <> element (usually same as the heading of the column).

Пример

Desktop view
People
NameSurnameAlias
ChadWilbertsMrOne
AdamSmithTheSmith
SophiaCandersonCandee
NickThomsonNickThom
MarkGerkisMarkie
JohnFergussonFergujohn
SylviaPouleauSylver
NormanJonesNormalJones
TrevorHeidelHeidi

Mobile view
People
NameSurnameAlias
ChadWilbertsMrOne
AdamSmithTheSmith
SophiaCandersonCandee

Пример кода

<table> <caption>People</caption> <thead> <tr> <th>Name</th> <th>Surname</th> <th>Alias</th> </tr> </thead> <tbody> <tr> <td data-label="Name">Chad</td> <td data-label="Surname">Wilberts</td> <td data-label="Alias">MrOne</td> </tr> <tr> <td data-label="Name">Adam</td> <td data-label="Surname">Smith</td> <td data-label="Alias">TheSmith</td> </tr> <tr> <td data-label="Name">Sophia</td> <td data-label="Surname">Canderson</td> <td data-label="Alias">Candee</td> </tr> </tbody> </table>

Modifiers

Horizontal Таблицы

You can create horizontal Таблицы (.horizontal), by applying the appropriate class.

Пример
People
NameSurnameAlias
ChadWilbertsMrOne
AdamSmithTheSmith
SophiaCandersonCandee
Пример кода
<table class="horizontal"> <caption>People</caption> <thead> <tr> <th>Name</th> <th>Surname</th> <th>Alias</th> </tr> </thead> <tbody> <tr> <td data-label="Name">Chad</td> <td data-label="Surname">Wilberts</td> <td data-label="Alias">MrOne</td> </tr> <tr> <td data-label="Name">Adam</td> <td data-label="Surname">Smith</td> <td data-label="Alias">TheSmith</td> </tr> <tr> <td data-label="Name">Sophia</td> <td data-label="Surname">Canderson</td> <td data-label="Alias">Candee</td> </tr> </tbody> </table>

Striped Таблицы

You can create striped Таблицы (.striped), by applying the appropriate class.

Пример
People
NameSurnameAlias
ChadWilbertsMrOne
AdamSmithTheSmith
SophiaCandersonCandee
Пример кода
<table class="striped"> <caption>People</caption> <thead> <tr> <th>Name</th> <th>Surname</th> <th>Alias</th> </tr> </thead> <tbody> <tr> <td data-label="Name">Chad</td> <td data-label="Surname">Wilberts</td> <td data-label="Alias">MrOne</td> </tr> <tr> <td data-label="Name">Adam</td> <td data-label="Surname">Smith</td> <td data-label="Alias">TheSmith</td> </tr> <tr> <td data-label="Name">Sophia</td> <td data-label="Surname">Canderson</td> <td data-label="Alias">Candee</td> </tr> </tbody> </table>

Hoverable Таблицы

You can create hoverable Таблицы (.hoverable), by applying the appropriate class.

Пример
People
NameSurnameAlias
ChadWilbertsMrOne
AdamSmithTheSmith
SophiaCandersonCandee
Пример кода
<table class="hoverable"> <caption>People</caption> <thead> <tr> <th>Name</th> <th>Surname</th> <th>Alias</th> </tr> </thead> <tbody> <tr> <td data-label="Name">Chad</td> <td data-label="Surname">Wilberts</td> <td data-label="Alias">MrOne</td> </tr> <tr> <td data-label="Name">Adam</td> <td data-label="Surname">Smith</td> <td data-label="Alias">TheSmith</td> </tr> <tr> <td data-label="Name">Sophia</td> <td data-label="Surname">Canderson</td> <td data-label="Alias">Candee</td> </tr> </tbody> </table>

Практика

<table>
  <caption>People</caption>
  <thead>
    <tr>
      <td>Bad idea</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th data-label="Bad">Also bad idea</th>
    </tr>
  </tbody>
</table>

Не рекомендуется:  Avoid placing <td> elements in the <thead> of your Таблицы, as well as placing <th> elements in the <tbody>.

Примечание

  • Remember to always specify a data-label attribute for all of your <td> elements, otherwise they will not display properly on mobile.
  • Due to the way Таблицы are displayed, the <tfoot> element is not supported by default. You can however add table tfoot { order: 3; } to your CSS files to partially support table footers.
  • Таблицы are vertically scrollable by default, with a max-height property of 400px.

Кастомизация

  • Text color for <th> and <td> elements can be changed by changing the values of the --table-head-fore-color and --table-body-fore-color variables respectively.
  • Background color for <th> and <td> elements can be changed by changing the values of the --table-head-back-color and --table-body-back-color variables respectively.
  • Border color for Таблицы can be changed by changing the value of the --table-border-color variable.
  • Border color for the separator between a table's heading and a table's body can be changed by changing the value of the --table-border-separator-color variable.
  • Alternative background color for <td> elements in striped Таблицы can be changed by changing the value of the --table-body-alt-back-color variable.
  • Hover background color for <tr> elements in hoverable Таблицы can be changed by changing the value of the --table-body-hover-back-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Text highlighting

The native HTML5 mark element has been minimally styled to allow for easy text highlighting.

Пример

This is a paragraph with some highlighted text.

Пример кода

<p>This is some <mark>highlighted text</mark>.</p>

Modifiers

Color variants

You can change the color of highlighted text, based on context by applying the appropriate class (secondary - .secondary or tertiary - .tertiary).

Пример

This is a secondary highlight and this is a tertiary highlight.

Пример кода
<p>This is a <mark class="secondary">secondary highlight</mark> and this is a <mark class="tertiary">tertiary highlight</mark>.</p>

Style variants

You can make highlights look like tags (.tag) or display as inline blocks (.inline-block), by applying the appropriate class.

Пример

This is a highlight styled as a tag.

This is some highlighted text that is displayed as an inline block.

Пример кода
<p>This is a highlight styled as a <mark class="tag">tag</mark>.</p> <p><mark class="inline-block">This is some highlighted text that is displayed as an inline block.</mark></p>

Практика

<mark class="inline-block"><mark class="secondary">Secondary highlight</mark> inside a inline block.</mark>

Рекомендуется:  You can nest a highlight inside another one, if the outer one is displayed as an inline-block.

<mark class="primary inverse">Highlight</mark>

Не рекомендуется:  Avoid applying multiple color modifiers on the same highlight.

Примечание

  • Highlighted text scales according to its parent element, so it can be used inside any kind of element (headings, forms, paragraphs etc.).

Кастомизация

  • Text color for highlighted text can be changed by changing the value of the --mark-fore-color variable.
  • Background color for highlighted text can be changed by changing the value of the --mark-back-color variable.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Toasts

mini.css provides you with toast messages (.toast), allowing you to display native-looking notifications on mobile devices.

Пример

This is a toast message!

Пример кода

<span class="toast">This is a toast message!</span>

Примечание

  • Toast elements do not have any pre-defined behavior, but you can use Javascript to add functionality to them.

Кастомизация

  • Text color for toast messages can be changed by changing the value of the --toast-fore-color variable.
  • Background color for toast messages can be changed by changing the value of the --toast-back-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Tooltips

You can utilize the aria-label property to create accessible tooltips (.tooltip), allowing you to display explanatory text for different elements.

Пример

Hover over this text to see a tooltip!

Пример кода

<span class="tooltip" aria-label="Tooltip text">Hover over text to see tooltip</span>

Modifiers

Position variant

You can make tooltips display below the related text, by adding the appropriate class (.bottom).

Пример

Hover over this text to see a tooltip!

Пример кода
<span class="tooltip bottom" aria-label="Tooltip text">Hover over text to see tooltip</span>

Примечание

  • Tooltips depend on the aria-label property, so they are fully accessible on screen readers.

Кастомизация

  • Text color for tooltips can be changed by changing the value of the --tooltip-fore-color variable.
  • Background color for tooltips can be changed by changing the value of the --tooltip-back-color variable.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.


Spoilers & accordions

mini.css provides you with accessible spoilers and accordions. They are composed of two components - the wrapper, the toggle button and the content container:

  • To create a collapsible spoiler, simply create a <div>, applying the appropriate class to it (.collapse). This serves as the wrapper for the collapsible spoiler.
  • Inside the wrapper, create a checkbox or radio input, immediately followed by a <label> for the checkbox. The former serves as your collapsible spoiler's control, while the latter is the toggle button for your collapsible spoiler.
  • Create a <div> right after the <label>. This will serve as the container for the collapsible content.

If you want to create an accordion, simply repeat the last two steps above for each section of the accordion. In order to make collapsible spoilers and accordions fully accessible, it is highly recommended to add the aria-hidden="true" attribute to all labels and inputs that control the behavior of these components.

Пример

This is the first section of the collapse

This is the second section of the collapse


This is the first section of the accordion

This is the second section of the accordion

Пример кода

<div class="collapse"> <input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">Collapse section 1</label> <div> <p>This is the first section of the collapse</p> </div> <input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">Collapse section 2</label> <div> <p>This is the second section of the collapse</p> </div> </div>
<div class="collapse"> <input type="radio" id="accordion-section1" checked aria-hidden="true" name="accordion"> <label for="accordion-section1" aria-hidden="true">Accordion section 1</label> <div> <p>This is the first section of the accordion</p> </div> <input type="radio" id="accordion-section2" aria-hidden="true" name="accordion"> <label for="accordion-section2" aria-hidden="true">Accordion section 2</label> <div> <p>This is the second section of the accordion</p> </div> </div>

Практика

<div class="collapse">
  <input type="checkbox" id="collapse-section1" checked aria-hidden="true">
  <!-- Do not place other stuff between these -->
  <label for="collapse-section1" aria-hidden="true">Collapse section 1</label>
  <!-- Do not place other stuff between these -->
  <div>
    <p>This is the first section of the collapse</p>
  </div>
</div>

Не рекомендуется:  You should not place anything between the checkbox controlling the collapsible spoiler and its label or between the label and the content container.

Примечание

  • Make sure all the radio Кнопки in the same accordion have the same name.
  • If you want a collapsible spoiler or an accordion section to be expanded by default, you can add the checked attribute to the respective collapsible spooiler's or section's control.
  • The max-height of the content container is 400px.
  • Using the aria-hidden="true" attribute is highly recommended, as screen readers will ignore the controls of the collapsible spoiler or accordion and read all the contained content normally.

Кастомизация

  • Background color, text color and background color on hover for the collapsible spoiler's labels can be changed by changing the values of --collapse-label-back-color, --collapse-label-fore-color and --collapse-label-hover-back-color respectively.
  • Border color for the collapsible spoiler can be changed by changing the value of the --collapse-border-color.
  • Background color for the collapsible spoiler's content can be changed by changing the value of the --collapse-content-back-color.
  • Background color and border for the spoiler's content selected labels can be changed by changing the values of the --collapse-selected-label-back-color and --collapse-selected-label-border-color respectively.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Progress bars

Progress bars are minimally styled to match with the rest of the framework's aesthetics and be consistent across all modern browsers.

Пример

Пример кода

<progress value="450" max="1000"></progress>

Modifiers

Inline progress bars

You can create inline progress bars (.inline), by applying the appropriate modifier.

Пример

45% completed...

Пример кода
<progress value="450" max="1000" class="inline"></progress>

Color variants

You can create primary, secondary or tertiary (.primary, .secondary, .tertiary) progress bars, simply by adding the appropriate color modifier.

Пример
Пример кода
<progress value="450" max="1000" class="primary"></progress> <progress value="450" max="1000" class="secondary"></progress> <progress value="450" max="1000" class="tertiary"></progress>

Практика

<progress value="45" max="100"></progress>
<progress value="450.0" max="1000.0"></progress>

Не рекомендуется:  Avoid using different values than 1000 for progress bars' max attribute, as well as floating point values for either max or value.


<progress value="450" max="1000" class="primary secondary"></progress>

Не рекомендуется:  Avoid applying two color modifiers on the same progress bar.

Примечание

  • Progress bars are designed to work with a max="1000" attribute, as this covers the most common use-cases.

Кастомизация

  • Foreground color for progress bars can be changed by changing the value of the --progress-fore-color variable.
  • Background color for progress bars can be changed by changing the value of the --progress-back-color variable.
  • You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal border radius for elements can be changed globally by changing the value of the --universal-border-radius variable.

Donut spinners

mini.css provides you with animated loading indicators (.spinner), which you can use to indicate that some content is loading.

Пример

Пример кода

<div class="spinner"></div>

Modifiers

Color variants

You can create primary, secondary or tertiary (.primary, .secondary, .tertiary) donut spinners, simply by adding the appropriate color modifier.

Пример
Пример кода
<div class="spinner primary"></div> <div class="spinner secondary"></div> <div class="spinner tertiary"></div>

Практика

<div class="spinner">Don't place text here.</div>

Не рекомендуется:  Avoid inserting text inside donut spinners.


<div class="spinner primary secondary"></div>

Не рекомендуется:  Avoid applying two color modifiers on the same donut spinner.

Примечание

  • You can use either a <div> or a <span> element to create a donut spinner.
  • You can add the role="progressbar" attribute to spinner donut elements to increase accessibility.
  • You can inline donut spinners inside a paragraph or some other textual content.

Кастомизация

  • Foreground color for donut spinners can be changed by changing the value of the --spinner-fore-color variable.
  • Background color for donut spinners can be changed by changing the value of the --spinner-back-color variable.
  • You can customize the colors of different color variants by changing the values of the related variables in their respective definitions.
  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.

Icons

 Powered by Feather

mini.css comes with a set of 20 commonly-used icons (courtesy of Feather) that you can use anywhere in your web apps, utilizing the appropriate class for each icon.

Пример

 .icon-alert

 .icon-bookmark

 .icon-calendar

 .icon-cart

 .icon-credit

 .icon-edit

 .icon-help

 .icon-home

 .icon-info

 .icon-link

 .icon-location

 .icon-lock

 .icon-mail

 .icon-phone

 .icon-rss

 .icon-search

 .icon-settings

 .icon-share

 .icon-upload

 .icon-user

Пример кода

<span class="icon-alert"></span> <span class="icon-bookmark"></span> <span class="icon-calendar"></span> <span class="icon-cart"></span> <span class="icon-credit"></span> <span class="icon-edit"></span> <span class="icon-help"></span> <span class="icon-home"></span> <span class="icon-info"></span> <span class="icon-link"></span> <span class="icon-location"></span> <span class="icon-lock"></span> <span class="icon-mail"></span> <span class="icon-phone"></span> <span class="icon-rss"></span> <span class="icon-search"></span> <span class="icon-settings"></span> <span class="icon-share"></span> <span class="icon-upload"></span> <span class="icon-user"></span>

Modifiers

Color variants

You can create secondary or inverse (.secondary, .inverse) icons, simply by adding the appropriate color modifier.

Пример

This is a secondary icon, which has a lighter color.

This is an inverse icon.

Пример кода
<span class="icon-alert secondary"></span> <span class="icon-alert inverse"></span>

Практика

<span class="icon-alert">Don't place text here.</span>

Не рекомендуется:  Avoid inserting text inside icon elements.


<span class="icon-alert inverse secondary"></span>

Не рекомендуется:  Avoid applying two color modifiers on the same icon.

Примечание

  • You can only use a <span> element to create an icon.
  • You can inline icons inside a paragraph or pretty much any other textual content. Icons scale relative to their parent element.

Кастомизация

  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.

Visibility helpers

You can use visibility helper classes to hide elements for all users (.hidden) or for users not on screen readers (.visually-hidden). There are also responsive visibility helpers provided, for hiding or visually hiding content only for specific screen sizes (.hidden-sm, .hidden-md, .hidden-lg and .visually-hidden-sm, .visually-hidden-md and .visually-hidden-lg respectively).

Пример кода

<p class="hidden">Not visible for any users.</p> <p class="visually-hidden">Visible only for screen readers.</p> <p class="hidden-sm">Not visible for users on screens under 768px wide.</p> <p class="hidden-md">Not visible for users on screens 768px-1280px wide.</p> <p class="hidden-lg">Not visible for users on screens wider than 1280px.</p> <p class="visually-hidden-sm">Visible only for screen readers under 768px wide.</p> <p class="visually-hidden-md">Visible only for screen readers 768px-1280px wide.</p> <p class="visually-hidden-lg">Visible only for screen readers wider than 1280px.</p>

Практика

<p class="hidden-sm hidden-md">Not visible for users on screens under 1280px wide.</p>

Рекомендуется:  You can apply multiple responsive visibility helpers on the same element.

<p class="hidden visually-hidden">Do not do this.</p>

Не рекомендуется:  Avoid combining .hidden and .visually-hidden or responsive helpers for the same screen size.

Примечание

  • Visibility helpers use !important declarations to override any other styles, so exercise caution when using them.
  • The specific breakpoints for small, medium and large screen sizes are as follows:
    • small: less than 768px wide
    • medium: more than or equal to 768px wide and less than 1280px wide
    • large: 1280px wide or more
  • Responsive visibility helper classes are independent, meaning that hiding or visually hiding an element in one screen size will not affect its visibility in any other screen size.

Element decorators

You can apply generic borders, shadows or border radiuses to any element, by using the appropriate class (.bordered, .shadowed, .rounded or .circular).

Пример


placeholder  placeholder

Пример кода

<span class="bordered">Bordered element.</span> <span class="shadowed">Shadowed element.</span> <span class="rounded">Rounded element.</span> <span class="circular">Circular element.</span>

Практика

<span class="rounded circular">Do not do this.</span>

Не рекомендуется:  Avoid applying the .rounded and .circular decorators on the same element.

Примечание

  • Element decorators use !important declarations to override any other styles, so exercise caution when using them.
  • Element decorators can be used with pretty much every element or component that is available.

Кастомизация

  • Boder color for the generic border decorator can be changed by changing the value of the --generic-border-color variable.
  • Box shadow style for the generic shadow can be changed by changing the value of the --generic-box-shadow variable.

Responsive spacing & sizing

You can make elements' spacing or sizing responsive by applying the appropriate class (.responsive-margin or .responsive-padding).

Пример кода

<span class="responsive-margin">Responsive margin.</span> <span class="responsive-padding">Responsive padding.</span>

Примечание

  • Responsive spacing and sizing modifiers use !important declarations to override any other styles, so exercise caution when using them.
  • Responsive spacing and sizing modifiers are independent, meaning that hiding or visually hiding an element in one screen size will not affect its visibility in any other screen size.

Кастомизация

  • Universal margin for elements can be changed globally by changing the value of the --universal-margin variable, affecting the responsive spacing modifier. As a rule of thumb, consider the universal margin to be the distance you want your paragraphs to have from the sides of the screen.
  • Universal padding for elements can be changed globally by changing the value of the --universal-padding variable, affecting the responsive sizing modifier.